
package com.chuangke.file.model;

import java.util.Date;

import com.chuangke.common.constant.Masks;
import com.chuangke.fss.model.FSSObject;

public class FileInfoVersion {

	private String id;
	private String signId;
	private int version;
	private String name;
	private String type;
	private String mimeType;
	private long size;
	private String storageType = "";
	private String storage1 = "";
	private String storage2 = "";
	private String thumStatus = Masks.BOOL_NO;
	private String thumStorage1 = "";
	private String thumStorage2 = "";
	private String indexStatus = Masks.BOOL_NO;
	private String md5hex;
	private String suffix;

	private int downloadCount;
	private int downloadPeopleCount;

	private String createdBy;
	private Date createdAt;
	private String updatedBy;
	private Date updatedAt;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSignId() {
		return signId;
	}

	public void setSignId(String signId) {
		this.signId = signId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public String getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdateAt() {
		return updatedAt;
	}

	public void setUpdateAt(Date updateAt) {
		this.updatedAt = updateAt;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getMimeType() {
		return mimeType;
	}

	public void setMimeType(String mimeType) {
		this.mimeType = mimeType;
	}

	public String getThumStatus() {
		return thumStatus;
	}

	public void setThumStatus(String thumStatus) {
		this.thumStatus = thumStatus;
	}

	public String getThumStorage1() {
		return thumStorage1;
	}

	public void setThumStorage1(String thumStorage1) {
		this.thumStorage1 = thumStorage1;
	}

	public String getThumStorage2() {
		return thumStorage2;
	}

	public void setThumStorage2(String thumStorage2) {
		this.thumStorage2 = thumStorage2;
	}

	public String getIndexStatus() {
		return indexStatus;
	}

	public void setIndexStatus(String indexStatus) {
		this.indexStatus = indexStatus;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public String getStorageType() {
		return storageType;
	}

	public void setStorageType(String storageType) {
		this.storageType = storageType;
	}

	public String getStorage1() {
		return storage1;
	}

	public void setStorage1(String storage1) {
		this.storage1 = storage1;
	}

	public String getStorage2() {
		return storage2;
	}

	public void setStorage2(String storage2) {
		this.storage2 = storage2;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

	public String getMd5hex() {
		return md5hex;
	}

	public void setMd5hex(String md5hex) {
		this.md5hex = md5hex;
	}

	public String getSuffix() {
		return suffix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	public int getDownloadCount() {
		return downloadCount;
	}

	public void setDownloadCount(int downloadCount) {
		this.downloadCount = downloadCount;
	}

	public int getDownloadPeopleCount() {
		return downloadPeopleCount;
	}

	public void setDownloadPeopleCount(int downloadPeopleCount) {
		this.downloadPeopleCount = downloadPeopleCount;
	}

	public FileInfo convertToFileInfo() {
		FileInfo fileInfo = new FileInfo();
		fileInfo.setId(this.getId());
		fileInfo.setName(this.getName());
		fileInfo.setType(this.getType());
		fileInfo.setSize(this.getSize());
		fileInfo.setStorageType(this.getStorageType());
		fileInfo.setStorage1(this.getStorage1());
		fileInfo.setStorage2(this.getStorage2());
		fileInfo.setSuffix(this.getSuffix());
		fileInfo.setDownloadCount(this.getDownloadCount());
		fileInfo.setDownloadPeopleCount(this.getDownloadPeopleCount());
		fileInfo.setVersion(this.getVersion());
		fileInfo.setMd5hex(this.getMd5hex());
		fileInfo.setThumStatus(this.getThumStatus());
		fileInfo.setThumStorage1(this.getThumStorage1());
		fileInfo.setThumStorage2(this.getThumStorage2());
		fileInfo.setIndexStatus(this.getIndexStatus());
		fileInfo.setMimeType(this.getMimeType());
		return fileInfo;
	}

	public FSSObject convert() {
		FSSObject fssObject = new FSSObject();
		fssObject.setName(this.getName());
		fssObject.setSize(this.getSize());
		fssObject.setSuffix(this.getSuffix());
		fssObject.setStorageType(this.getStorageType());
		fssObject.setStorage1(this.getStorage1());
		fssObject.setStorage2(this.getStorage2());
		fssObject.setMd5hex(this.getMd5hex());
		fssObject.setMimeType(this.getMimeType());
		
		return fssObject;
	}

	public void convert(FSSObject fssObject) {
		this.setStorage1(fssObject.getStorage1());
		this.setStorage2(fssObject.getStorage2());

		this.setStorageType(fssObject.getStorageType());
	}

}
